$(function () {
    var slider = mui("#slider");
    slider.slider({
        interval: 3000
    });
    /**
     * 查询通知公告
     */
    $.ajax({
        type:"GET",
        url:"/uc/schedule/list/notice",
        data: {"content": 0, "title": ""},
        dataType:"json",
        error:function () {
            console.log("请求失败！");
        },
        success:function (data) {
            var html="";
            if(null!=data&&""!=data){
                var dataList=data.dataList;
                if(null!=dataList&&dataList.length>0){
                    for (var i=0;i<dataList.length;i++){
                        html=html+"<li class='mui-table-view-cell mui-media'>" +
                            "<a class='mui-navigate-right' href='/uc/schedule/notice/"+dataList[i].id+"/index'>" +
                            "<div class='mui-media-body mui-ellipsis'>"+dataList[i].title+
                            "<p class='mui-ellipsis custom-ellipsis-size'>部门："+dataList[i].foldername+"&nbsp;&nbsp;时间："+dataList[i].publishtime+"</p>" +
                            "</div></a></li>";
                    }
                }
            }
            $(".custom-notice").html(html);
        }
    });
    /**
     *查询学院讲座
     */
    $.ajax({
        type:"GET",
        url:"/uc/schedule/ajax/user/lecture",
        data: {"content": 0, "title": ""},
        dataType:"json",
        error:function () {
            console.log("请求失败！");
        },success:function (data) {
            var html="";
            if(null!=data&&""!=data) {
                var dataList = data.dataList;
                if (null != dataList && dataList.length > 0) {
                    for (var i=0;i<dataList.length;i++){
                        html=html+"<li class='mui-table-view-cell mui-media'>" +
                            "<a class='mui-navigate-right' href='/uc/schedule/entity/"+dataList[i].id+"/lecture'>" +
                            "<div class='mui-media-body mui-ellipsis'>"+dataList[i].bt+
                            "<p class='mui-ellipsis custom-ellipsis-size'>时间："+dataList[i].sj+"</p>" +
                            "</div></a></li>";
                    }
                }
            }
            $(".custom-lecture").html(html);
        }
    });
    /**
     *查询学院发文
     */
    $.ajax({
        type:"GET",
        url:"/uc/schedule/ajax/user/dispatch",
        data: {"content": 0, "title": ""},
        dataType:"json",
        error:function () {
            console.log("请求失败！");
        },success:function (data) {
            var html="";
            if(null!=data&&""!=data) {
                var dataList = data.dataList;
                if (null != dataList && dataList.length > 0) {
                    for (var i=0;i<dataList.length;i++){
                        html=html+"<li class='mui-table-view-cell mui-media'>" +
                            "<a class='mui-navigate-right'  href='/uc/schedule/entity/"+dataList[i].id+"/dispatch'>" +
                            "<div class='mui-media-body mui-ellipsis'>"+dataList[i].bt+
                            "<p class='mui-ellipsis custom-ellipsis-size'>文号："+dataList[i].wh+"</p>" +
                            "</div></a></li>";
                    }
                }
            }
            $(".custom-dispatch").html(html);
        }
    });
});